Re: [SQL] convert text to varchar

Поиск
Список
Период
Сортировка
От Herouth Maoz
Тема Re: [SQL] convert text to varchar
Дата
Msg-id l03130308b3537874e3d1@[147.233.159.109]
обсуждение исходный текст
Ответ на convert text to varchar  (JT Kirkpatrick <jt-kirkpatrick@mpsllc.com>)
Список pgsql-sql
At 18:33 +0300 on 03/05/1999, JT Kirkpatrick wrote:


> hi!  i have a text field (table ap3, field name apnote) that i would like
> to insert into a varchar field (same field name, table name ap).  any idea
> why this doesn't work?  insert into ap (apnote) select varchar('apnote')
> from ap3; -- it fails with or without the single quotes.

Should be simply

INSERT INTO ap (apnote)
SELECT ap3.apnote
FROM ap3;

You really shouldn't have single quotes, and the conversion to text is
supposed to be automatic.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma




В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] Slow Inserts Again
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [SQL] No DIVIDE Operator